package com.shengqin.config.handlers;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.TypeReference;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.shengqin.entity.TestResult;
import com.shengqin.pojo.plan.TestDateRangeModel;

import java.time.format.DateTimeFormatter;
import java.util.List;

public class TestDateRangeTypeHandler extends FastjsonTypeHandler {

    public static final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");

    public TestDateRangeTypeHandler(Class<?> type) {
        super(type);
    }

    @Override
    public Object parse(String json) {
        return JSON.parseObject(json,new TypeReference<List<TestDateRangeModel>>(){});
    }
}
